************************
Terrorism, perpetrators and polarization: Evidence from natural experiments
Vincenzo Bove
Riccardo Di Leo
Georgios Efthyvoulou
Harry Pickard
************************

******
Notes for the replicator: 
******

It is sufficient to run the do-file "0. do_MASTER" to replicate the whole paper.

At the beginning of the do-file "0. do_MASTER", the replicator will find a series of notes. These need to be un-commented and will perform the following tasks:
- install packages from SSC and net
- set the directory where the replication datasets are stored, and created the folders where figures and tables will be saved.

The variables "id" and "wave" will allow to merge the dataset with the appropriate edition of the BES panel dataset (Waves 1-20) 



******
This data release contains the following files:
******

******
1. Code to replicate the analysis
******
File names: 

	a. "0. do_MASTER" is the Stata do-file setting the directory and calling the two do files below.
	NOTE FOR THE REPLICATOR: it is sufficient to run this do-file to replicate the whole paper.

	b. "1. main_paper" is the Stata do-file to be used when replicating the figures and tables contained in the main body of the paper.

	c. "2. appendix" is the Stata do-file be used when replicating the tables and figures contained in the Online Appendix.


******
2. BES Data used in the analysis
******

File name: "Polarization_clean.dta"

Source: Fieldhouse, E., J. Green, G. Evans, J. Mellon & C. Prosser, J. Bailey, R. de Geus, H. Schmitt and C. van der Eijk (2023) British Election Study Internet Panel Waves 1-20. DOI: 10.5255/UKDA-SN-8810-1 
Available online. See: https://www.britishelectionstudy.com/data-objects/panel-study-data/

Note: we only kept respondents interviewed in the week before and after each of the four terrorist attacks covered in the paper.
Attack dates and perpetrators were cross-checked via the Global Terrorist Database (GTD).

Source: START (National Consortium for the Study of Terrorism and Responses to Terrorism). (2022). Global Terrorism Database 1970 - 2020 [data file]. https://www.start.umd.edu/gtd  
Available online: https://www.start.umd.edu/gtd/using-gtd/CitingGTD.aspx

Note: the polarization index is constructed following Wagner, M. (2021). Affective polarization in multiparty systems. Electoral Studies, 69, 102199.


******
3. Twitter Data
******

These data could not be shared due to changes in Twitter's Terms&Conditions.
The code to replicate Figure 4 and Figure C.13a is provided in the do.files, but the data cannot be shared, as it employs proprietary information from Twitter. 
The data employed in the analysis can be downloaded from Twitter, using the API: https://developer.twitter.com/en/docs/twitter-api


******
4. Codebook
******
File name: "Codebook_polarization": a Codebook with variable definitions for all variables in the analysis and value labels for categorical variables



******
Other information for replication:
******

OS: Windows 10.0.19044

Software: Stata/SE v17.0 for Windows; 

Packages to install (SSC): "reghdfe" "ebalance "center" "estout" "grstyle" "coefplot" "kountry "rangestat" "rangejoin" "nearmrg" "copydesc"

Packages to install (net): "scheme-hp" from("https://raw.githubusercontent.com/harrypickard/stata-scheme-hp/main/" 	